package com.spring.focus.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainTest {
	
	public static void main(String [] args){
		  ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
	        /**调用getBean方法获取bean对象 需要强制造型*/
	        GreetingService gsi = (GreetingService) ac.getBean("greetingServiceImpl");
	        /**调用对象相应的方法*/
	        gsi.sayGreeting();
	}

}
